/*
 * Copyright (c) 2018.
 * http://www.ulabcare.com
 */

package com.mt.roll.upms.params;

import com.mt.roll.core.enums.HttpMethodEnum;
import com.mt.roll.core.enums.ResourceCategoryEnum;
import com.mt.roll.core.enums.SubsystemEnum;
import com.mt.roll.core.params.BasePageParam;
import com.mt.roll.core.validator.constraints.Enum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 资源
 * </p>
 *
 * @author jiff
 * @date 2018/11/22
 * @since 1.0
 */
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Data
@Builder
@ApiModel(value = "资源查询参数", description = "用于查询资源信息")
public class ResourceQueryParam extends BasePageParam {

    /**
     * 服务ID
     */
    @ApiModelProperty(value = "服务ID", required = false, example = "1")
    private Long serviceId;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", required = false, example = "新增资源")
    private String name;

    /**
     * 请求地址，可以用于前端ajax调用，后端用于做权限控制
     */
    @ApiModelProperty(value = "请求地址，可以用于前端ajax调用，后端用于做权限控制", required = false, example = "/platform-upms/resource/add")
    private String url;

    /**
     * 请求类型：GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
     */
    @ApiModelProperty(value = "请求类型：GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE", required = false, example = "post")
    @Enum(message = "非法的请求类型", target = {HttpMethodEnum.class})
    private String method;

    /**
     * 子系统:0、common，1、platform，2、partner，3、 hospital，4、patient
     */
    @ApiModelProperty(value = "子系统:0、common，1、platform，2、partner，3、 hospital，4、patient", required = false, example = "0")
    @Enum(message = "非法的子系统类型", target = {SubsystemEnum.class})
    private Integer subsystem;

    /**
     * 分类:0、common，1、pc，2、app，3、wechat，4、miniapp
     */
    @ApiModelProperty(value = "分类:0、common，1、pc，2、app，3、wechat，4、miniapp", required = true, example = "0")
    @Enum(message = "非法的资源分类", target = {ResourceCategoryEnum.class})
    private Integer category;

}
